-- close_func
--
local import = import
---@type behavior_ret
local bret = import("bt/bt_plugin/behavior3/behavior_ret")

---@type MAIN_TARGET_TYPE_CONFIG
local MAIN_TARGET_TYPE_CONFIG = import("bt/custom_node/enum_type_cfg/MAIN_TARGET_TYPE_CONFIG")
local M = {
    name = "close_func",
    type = "Action",
    desc = "关闭功能",
    args = {
        {
            name = "close_func",
            type = "enum",
            desc = "屏蔽的功能",
            options = MAIN_TARGET_TYPE_CONFIG.close_func_options
        },
    },
}

function M.run(node, env, value)
    local owner = env.owner
    local close_func = node.args.close_func
    if not owner.closeFuncArr then
        owner.closeFuncArr = {}
    end
    owner.closeFuncArr[close_func] = true
    return bret.SUCCESS
end

return M
